package flexdb

import (
	"encoding/json"
	tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http"
)

type ListTablesRequest struct {
	*tchttp.BaseRequest

	MgoLimit *int64 `json:"MgoLimit,omitempty" name:"MgoLimit"`

	MgoOffset *int64 `json:"MgoOffset,omitempty" name:"MgoOffset"`

	Tag *string `json:"Tag,omitempty" name:"Tag"`
}

func (r *ListTablesRequest) ToJsonString() string {
	b, _ := json.Marshal(r)
	return string(b)
}

func (r *ListTablesRequest) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}

type ListTablesResponse struct {
	*tchttp.BaseResponse
	Response *struct {
		Tables []*Table `json:"Tables,omitempty" name:"Tables"`

		Pager *struct {
			Offset *int64 `json:"Offset,omitempty"`

			Limit *int64 `json:"Limit,omitempty"`

			Total *int64 `json:"Total,omitempty"`
		} `json:"Pager"`

		// 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func (r *ListTablesResponse) ToJsonString() string {
	b, _ := json.Marshal(r)
	return string(b)
}

func (r *ListTablesResponse) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}

type Table struct {
	TableName *string `json:"TableName,omitempty" name:"TableName"`

	Count *int64 `json:"Count,omitempty" name:"Count"`

	Size *int64 `json:"Size,omitempty" name:"Size"`

	IndexCount *int64 `json:"IndexCount,omitempty" name:"IndexCount"`

	IndexSize *int64 `json:"IndexSize,omitempty" name:"IndexSize"`
}

type QueryRequest struct {
	*tchttp.BaseRequest

	MgoLimit *int64 `json:"MgoLimit,omitempty" name:"MgoLimit"`

	MgoOffset *int64 `json:"MgoOffset,omitempty" name:"MgoOffset"`

	MgoQuery *string `json:"MgoQuery,omitempty" name:"MgoQuery"`

	Tag *string `json:"Tag,omitempty" name:"Tag"`

	TableName *string `json:"TableName,omitempty" name:"TableName"`
}

func (r *QueryRequest) ToJsonString() string {
	b, _ := json.Marshal(r)
	return string(b)
}

func (r *QueryRequest) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}

type QueryResponse struct {
	*tchttp.BaseResponse
	Response *struct {
		Data []*string `json:"Data,omitempty"`

		Pager *struct {
			Offset *int64 `json:"Offset,omitempty"`

			Limit *int64 `json:"Limit,omitempty"`

			Total *int64 `json:"Total,omitempty"`
		} `json:"Pager"`

		// 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func (r *QueryResponse) ToJsonString() string {
	b, _ := json.Marshal(r)
	return string(b)
}

func (r *QueryResponse) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}

type PutItemRequest struct {
	*tchttp.BaseRequest

	MgoDocs []*string `json:"MgoDocs,omitempty" name:"MgoDocs"`

	Tag *string `json:"Tag,omitempty" name:"Tag"`

	TableName *string `json:"TableName,omitempty" name:"TableName"`
}

func (r *PutItemRequest) ToJsonString() string {
	b, _ := json.Marshal(r)
	return string(b)
}

func (r *PutItemRequest) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}

type PutItemResponse struct {
	*tchttp.BaseResponse
	Response *struct {
		InsertedIds []*string `json:"InsertedIds,omitempty" name:"InsertedIds"`

		// 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func (r *PutItemResponse) ToJsonString() string {
	b, _ := json.Marshal(r)
	return string(b)
}

func (r *PutItemResponse) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}
